package com.bluesky.light.category;

import java.util.List;

public class CategoryService {
	
	/**
	 * 
	 */
	private static CategoryService service;
	
	/**
	 * 
	 */
	private static CategoryDAO dao = new CategoryDAO();
	
	/**
	 * 
	 */
	private CategoryService() {}
	
	/**
	 * @return
	 */
	public static CategoryService getInstance() {
		if (service == null) {
			service = new CategoryService();
		}
		return service;
	}
	
	/**
	 * @return
	 */
	public List<Category> getCategories() {
		return dao.getCategories();
	}
	
	/**
	 * @param c
	 */
	public void add(Category c) {
		dao.add(c);
	}
	
	/**
	 * @param id
	 * @return
	 */
	public Category loadById(int id) {
		return dao.loadById(id);
	}
	
	/**
	 * @param c
	 */
	public void update(Category c) {
		dao.update(c);
	}
}
